﻿<%@ Page Title="Bewerk Tickets" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Tickets.aspx.cs" Inherits="WebApplication2.EditPages.Tickets" %>
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1><%: Title %>.</h1>
                <h2>Groep16 - Festivalinfo</h2>
            </hgroup>
            <p>
                Hier kan je de gegevens van de tabel Tickets bewerken.
            </p>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="fest_id,gebr_id" DataSourceID="SqlDataSource1" AutoGenerateEditButton="True" AutoGenerateDeleteButton="True" OnRowEditing="GridView1_RowEditing" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting">
        <Columns>
            <asp:BoundField DataField="fest_id" HeaderText="festId" ReadOnly="True" SortExpression="fest_id" />
            <asp:BoundField DataField="gebr_id" HeaderText="gebrId" ReadOnly="True" SortExpression="gebr_id" />
            <asp:BoundField DataField="typ_id" HeaderText="typId" SortExpression="typ_id" />
            <asp:BoundField DataField="ticket_datum" HeaderText="datum" SortExpression="ticket_datum" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:groep16_festivalsConnectionString %>" SelectCommand="SELECT * FROM [tickets]" DeleteCommand="DELETE FROM [tickets] WHERE [fest_id] = @fest_id AND [gebr_id] = @gebr_id" InsertCommand="INSERT INTO [tickets] ([fest_id], [gebr_id], [typ_id], [ticket_datum]) VALUES (@fest_id, @gebr_id, @typ_id, @ticket_datum)" UpdateCommand="UPDATE [tickets] SET [typ_id] = @typ_id, [ticket_datum] = @ticket_datum WHERE [fest_id] = @fest_id AND [gebr_id] = @gebr_id">
        <DeleteParameters>
            <asp:Parameter Name="fest_id" Type="Int32" />
            <asp:Parameter Name="gebr_id" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="fest_id" Type="Int32" />
            <asp:Parameter Name="gebr_id" Type="Int32" />
            <asp:Parameter Name="typ_id" Type="Int32" />
            <asp:Parameter DbType="Date" Name="ticket_datum" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="typ_id" Type="Int32" />
            <asp:Parameter DbType="Date" Name="ticket_datum" />
            <asp:Parameter Name="fest_id" Type="Int32" />
            <asp:Parameter Name="gebr_id" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>

</asp:Content>